<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=yes" name="format-detection" />
    <link href="css/index.css" rel="stylesheet" type="text/css">
    <link href="css/Login.css" rel="stylesheet" type="text/css">
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/layer/layer.js"></script>
    <script src="js/jquery.md5.js"></script>
</head>
<body>
<div class="viewport">
    <div class="header">
        <div class="header-1"><div class="header-1-1"></div> </div>
        <div class="header-2">农商易</div>
        <div class="header-3"><div class="header-3-1"></div> </div>
    </div>
    <div class="blank"></div>
    <div class="content">
        <div class="content-1"><div class="content-1-1"></div></div>
        <div class="content-2"><input type="text" placeholder="农商易号/手机号/邮箱" maxlength="25px" id="username"></div>
        <div class="content-2"><input type="password" placeholder="请输入密码" maxlength="25px" id="password"></div>
        <div class="content-3"><input type="button" value="登 录" id="submit"></div>
        <div class="content-4">
            <a href="registered.html" class="content-4-1">免费注册</a>
            <a href="ForgotPassword.html" class="content-4-2">忘记密码</a>
        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    $(function(){
        $("#submit").click(function(){
            var username=$("#username").val();
            var patrn =/^1[3,5,8]\d{9}$/;
            var patrn1=/^1[3|4|5|7|8][0-9]\d{4,8}$/;
            var password=$("#password").val();
            if(username==""){
                layer.msg("请输入手机号码",{shadeClose:true,shade:0.1,time:2000})
            }
            else if(!patrn.test(username)){
                layer.msg("输入的手机号码不正确",{shadeClose:true,shade:0.1,time:2000})
            }
            else if(password==""){
                layer.msg("请输入密码",{shadeClose:true,shade:0.1,time:2000})

            }
            else{
                layer.closeAll();
                window.location.href="mine2.html";
                /*var index =layer.load(2,{content:"loading..."});
                var test=null;
                if(patrn1.test(username)){
                    test=2;
                }
                else{
                    test=1;
                }
                $.ajax({
                    type:"post",
                    url:"/nsy-web/api/card/centerService",
                    data:{
                        serviceCode:"5003",
                        sign:"5f9e152adc8953f31487140d6c0982a590b2ca10",
                        timestamp:"20160627111123",
                        nonce:"123456789",
                        editUser:"zhangsan",
                        editTime:"2016-06-27%2011:11:27",
                        registerNum:username,
                        registerType:"p",
                        pwd: password
                    },
                    success:function(data){
                        var d = eval("("+data+")");
                        if(d.returnCode=="200"){
                            layer.close(index);
                            window.location.href="mine2.html"
                        }
                        else if(d.returnCode=="20050"){
                            layer.close(index);
                            layer.msg("账号不存在",{shadeClose:true,shade:0.1,time:2000})
                        }
                        else if(d.returnCode=="20060"){
                            layer.close(index);
                            layer.msg("登录失败",{shadeClose:true,shade:0.1,time:2000})
                        }
                        else{
                            layer.close(index);
                            layer.msg("登录错误",{shadeClose:true,shade:0.1,time:2000})
                        }
                    }
                })*/
            }
        })
    });
</script>
